<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

use View;
use DB;


class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //打印sql日志
         //\DB::listen(function($query) { \Log::info($query); });
        $nav = '互联网';
        $link ="百度";
        View::share(['nav'=>$nav,'link'=>$link]);


     /*   View::composer(['blog.master','blog.index'],function($view){
        $view->with('user','kent');
    });*/
        View::composer('*',function($view){
            $view->with('user','kent');
        });

    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
}
